#cc = swcc -O3
#cc_slave = sw3cc -O3

#cc = sw5cc.old -host -O3
#cc_slave = sw5cc.old  -O3

cc = sw5cc -host -O3
cc_slave = sw5cc -slave -O3

FLAGS_S= -DTMAX=100 -DNX=2000 -DNY=2000  -DTZ1=50 -DTZ2=50 -DPROFILING# -S
FLAGS_D= -DTMAX=100 -DNX=1000 -DNY=1000  -DTZ1=25 -DTZ2=40 -DPROFILING# -S

LIBFLAGS =  -I/usr/sz/swcc/sw3gcc-binary/include

OBJECT = master.o slave.o
OBJECT_S = master_s.o slave_s.o
OBJECT_D = master_db.o slave_db.o

#3d7p_stream: master.o slave.o stream
all: stream single double

master.o: master.c
	$(cc) $(FLAGS_S)  -c  master.c  $(LIBFLAGS)
master_s.o: master_s.c
	$(cc) $(FLAGS_S)  -c  master_s.c  $(LIBFLAGS)
master_db.o: master_db.c
	$(cc) $(FLAGS_D)  -c  master_db.c  $(LIBFLAGS)
slave.o: slave.c
	$(cc_slave) $(FLAGS_S)  -c slave.c
slave_s.o: slave_s.c
	$(cc_slave) $(FLAGS_S)  -c slave_s.c
slave_db.o: slave_db.c
	$(cc_slave) $(FLAGS_D)  -c slave_db.c
stream:  $(OBJECT) 
	$(cc_slave) -hybrid  -o fdtd_stream $(OBJECT)
single:  $(OBJECT_S) 
	$(cc_slave) -hybrid  -o fdtd_single $(OBJECT_S)
double:  $(OBJECT_D) 
	$(cc_slave) -hybrid  -o fdtd_double $(OBJECT_D)
clean:
	@-rm -f *.o fdtd_stream fdtd_single fdtd_double

